import request from '@/utils/request'


//对应后端查询角色列表接口
export const FindByPage = (pageNum,pageSize,sysRoleDto)=>{
    return request({
        url:`/admin/system/sysRole/findByPage/${pageNum}/${pageSize}`,
        method:'post',
        data:sysRoleDto
    })
}

//对应后端删除角色接口
export const DeleteById = (roleId)=>{
    return request({
        url:`/admin/system/sysRole/deleteById/${roleId}`,
        method:'delete'
    })
}


//对应后端添加角色接口
export const AddRole = (sysRole)=>{
    return request({
        url:`/admin/system/sysRole/addRole`,
        method:'post',
        data:sysRole
    })
}

//对应后端修改角色接口
export const UpdateRole = (sysRole)=>{
    return request({
        url:`/admin/system/sysRole/updateRole`,
        method:'put',
        data:sysRole
    })
}

//对应后端查询所有角色接口
export const FindAllRoleAndRoleIdList = (userId)=>{
    return request({
        url:`/admin/system/sysRole/findRoleListAndRoleIdList/${userId}`,
        method:'get',
    })
}

//对应后端为用户分配角色解救
export const DoAssign = (assginRoleDto)=>{
    return request({
        url:`/admin/system/sysRole/doAssign`,
        method:'post',
        data:assginRoleDto
    })
}